package com.ww.scala.trys

object TestScala04 {
  private val nn=""
  private val xx=new TestScala04("18","oooo")

  def main(args: Array[String]): Unit = {
    println(s"hello world${xx.name},${xx.age}")
  }


}
//age 默认是val ,private 修饰的
class TestScala04(private var age:String) {
  var name="xxxx"
  println("我是默认构造方法")
  def this(xname:String,age:String){
    this(age)
    name=xname
    //可以访问到伴生object中的private的属性
    println(s"${TestScala04.nn}")
  }
}
